package top.aigoo.project01.websueradmin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import top.aigoo.project01.entity.Area;
import top.aigoo.project01.service.AreaService;

import java.util.ArrayList;
import java.util.HashMap;

import java.util.List;
import java.util.Map;

import static com.alibaba.druid.sql.ast.SQLPartitionValue.Operator.List;

/**
 * @Description: 请填写该类完成的功能
 * @Author: Mr.OYSHUO.欧阳大叔  mail:1642302522@qq.com
 * @Version 1.0.0
 * @Date: 2021/8/6 0:45
 */
@Deprecated
@Controller
@RequestMapping(value = "/superadmin", method = RequestMethod.GET)
public class AreaController {
    @Autowired
    private AreaService areaService;


    private Map<String, Object> listArea(){
        Map<String, Object> modelMapper = new HashMap<String, Object>();
        List<Area> list = new ArrayList<Area>();
        try {
            list = areaService.getAreaList();
            modelMapper.put("rows", list);
            modelMapper.put("total", list.size());
        } catch (Exception e) {
            e.printStackTrace();
            modelMapper.put("success", false);
            modelMapper.put("errMsg", list.size());
        }
        return modelMapper;
    }

    ;
}
